package com.xcity.game.activity.gift;

import naga.x.util.NumberUtils;

@Deprecated
public class ExchangeCode {

	protected String code;
	protected int type;
	
	public ExchangeCode(String code, int type) {
		this.code = code;
		this.type = type;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Override
	public String toString() {
		return code + ',' + type;
	}
	
	public static ExchangeCode parse(String line) {
		int dot = line.indexOf(',');
		String code = line.substring(0, dot);
		int type = NumberUtils.parseInt(line.substring(dot + 1));
		return new ExchangeCode(code, type);
	}
	
}
